home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93c.txt / 000036_icon-group-sender _Sat Aug 28 13:56:52 1993.msg < prev    next >
Internet Message Format  |  1994-02-02  |  1KB

  1. Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Sat, 28 Aug 1993 17:21:55 MST
  2. Received: by owl.cs.arizona.edu; Sat, 28 Aug 1993 17:21:54 MST
  3. Date: 28 Aug 93 13:56:52 GMT
  4. From: sdd.hp.com!portal!cup.portal.com!Eric-Amick@hplabs.hpl.hp.com  (Richard E Amick)
  5. Organization: The Portal System (TM)
  6. Subject: Re: system() function
  7. Message-Id: <89125@cup.portal.com>
  8. References: <1993Aug28.000650.682@jcnpc.cmhnet.org>
  9. Sender: icon-group-request@cs.arizona.edu
  10. To: icon-group@cs.arizona.edu
  11. Status: R
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13.  
  14. >    I have a 286 running under dos 3.3.  I use the system() function
  15. >to issue the VOL command to dos to see the volume label of the disk
  16. >in drive A:.  System() returns the dos exit code and not the response
  17. >returned by the VOL command.  Therefore x := system("Vol") does not
  18. >capture the volume label as returned by Vol but rather captures 0,
  19. >which is the exit code.
  20. >    Is there a way under ICON 8.0 to capture the volume label returned
  21. >by the dos Vol command as a string?  If so, how?
  22.  
  23. The key is to remember that any valid command line can be fed to
  24. system(); try something like
  25.  
  26. system("vol >somefile")
  27.  
  28. then open and read "somefile".  You can figure out the rest, I'm sure.
  29.